package com.comeon.testtree;

import java.io.File;

public class TestTree {
	public static void main(String[] args) {
		File f = new File("D:\\工具");
		printTree(f,0);
	}
	static void printTree(File f,int level){
		for(int i =0;i<=level;i++){
			System.out.print("-");
		}
		System.out.println(f.getName());
		if(f.isDirectory()){
			File[] files = f.listFiles();
			for(File file :files){
				printTree(file,level+1);
			}
			
		}
	}

}
